package com.jxau.mapper;

import com.jxau.entity.Comment;
import com.jxau.entity.Temp;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

public interface CommentMapper {
    /**
     * 文章下评论（无回复者）
     * @param comment
     */
    void addCommentUnderArticle(Comment comment);

    /**
     * 已有评论下回复
     * @param comment
     */
    void addCommentReply(Comment comment);

    /**
     * 查找我的评论
     * @param uid
     * @return
     */
    ArrayList<Comment> queryMyComment(String uid);


    List<Temp> getAllComments();

    List<Temp> findCommentByName(String name);

    int deleteCommentById(int id);

    ArrayList<Comment> queryCommentOfArticle(@Param("articleId") int articleId, @Param("uid") String uid);

    ArrayList<Comment> queryCommentOfUser(String uid);

    Integer queryIsLike(@Param("uid") String uid, @Param("id") Integer id);

    Integer queryLikeNum(Integer id);

    void updateReadFlagOfUser(String uid);
}
